#ifndef __HALLLAYER_H__
#define __HALLLAYER_H__
#include "../imilibs/IMILayer.h"
#include "../imilibs/IMISprite.h"
#include "../imilibs/IMILoad.h"
#include "../data/IMIData.h"
#include "../imilibs/IMIButton.h"
#include "../actions/CCallFuncDelay.h"
#include "../imilibs/IMIEventData.h"
#include "../EventType.h"

#include "../imilibs/IMIBasicBg.h"

//***********************
//HallLayer
//***********************
class HallLayer:public IMILayer
{
public:
	//
	HallLayer(){};
	virtual ~HallLayer();
	static HallLayer *create(void);
	void onEnter();
	void onExit();
	bool init();

	//
	void loadResoure();
	void resoureComplete(int pecent,bool isComplete);
	void uiInit();
	void setAllPosition();
	void compiz();
	void tabShowHandler(CCObject * obj);
	void topButtomShowHandler(CCObject * obj);

	void btn0Handler(CCObject* object, CCTouch *pTouch, CCEvent *pEvent);
	void btn1Handler(CCObject* object, CCTouch *pTouch, CCEvent *pEvent);
	void btn2Handler(CCObject* object, CCTouch *pTouch, CCEvent *pEvent);
	void btn3Handler(CCObject* object, CCTouch *pTouch, CCEvent *pEvent);
	void btn4Handler(CCObject* object, CCTouch *pTouch, CCEvent *pEvent);
	void shopHandler(CCObject* object, CCTouch *pTouch, CCEvent *pEvent);

	void noticeHandler(CCObject* obj);

private:
	CCLayer * topLayer;
	CCLayer * bgLayer;
	CCLayer * middleLayer;
	CCLayer * buttomLayer;
	CCLayer * middleTabLayer;

	CCSprite * m_bg;
	CCSprite * m_topBg;
	CCSprite * m_buttomBg;
	CCSprite * m_noticeBg;
	CCSprite * tabBg;

	IMISprite * normalRoom;
	IMISprite * matchRoom;

	IMISprite * room0;
	IMISprite * room1;
	IMISprite * room2;

	IMISprite * btn0;
	IMISprite * btn1;
	IMISprite * btn2;
	IMISprite * btn3;
	IMISprite * btn4;

	IMISprite * headbg;
	CCSprite *	nameIcon;
	CCSprite * moneytIcon;

	IMISprite * shopBtn;

	CCTextFieldTTF * m_nameTxt;
	CCTextFieldTTF * m_moneyTxt;

	CCSprite * m_noticeIcon;
	CCTextFieldTTF * m_noticeTxt;
	float m_noticeY;

};

#endif // __HALLLAYER_H__